﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;


public partial class NewsDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["id"] != null)
            {
                int iID = int.Parse(Request.QueryString["id"].ToString());
                get_DETAIL_NEWS(iID);                
            }
        }
    }

    public void get_DETAIL_NEWS(int iID)
    {
        DataTable dtNews = BusLogic.News.get_DETAIL_NEWS(iID).Tables[0];

        if (dtNews.Rows.Count > 0)
        {
            ltTitle.Text = dtNews.Rows[0]["TITLE"].ToString();
            ltSummary.Text = dtNews.Rows[0]["SUMMARY"].ToString();
            ltViewNews.Text = dtNews.Rows[0]["CONTENT"].ToString();

            int iCatID = int.Parse(dtNews.Rows[0]["CATEID"].ToString());
            Page.Title = ltTitle.Text;


            ltlCategoryName.Text = BusLogic.Category.get_CATEGORY(iCatID).Tables[0].Rows[0]["NAME"].ToString();
        }

        int iCateID = int.Parse(dtNews.Rows[0]["CATEID"].ToString());
                
    }
}
